5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
- Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 4-6: ILF Keyword Reference

TOTAL


The TOTAL statement accumulates subtotals and grand totals in output and update processes.

  ?????   TOTAL     ??? ?????????????????????? ??? ?  ??? ?????????????????????? ???
  (1)               (2) (3)                    (4)(5) (6) (7)                    (8)

(1) T/F execution conditions
(2) 1st application ID
(3) 1st field name or PDF
(4) 1st occurrence (constant/index)
(5) Operator (+, -, P, M)
(6) 2nd application ID
(7) 2nd field name, PDF, or constant
(8) 2nd occurrence (constant/index)

Using the Statement

TOTAL adds to (+), hash-adds to (P), subtracts from (-), or hash-subtracts from (M) the first operand using the amount indicated in the second operand. However, rather than storing the result in the the first operand, the total is accumulated internally within APPX.

TOTAL is a special use of a numeric field that occurs only in output and update processes. TOTAL maintains running totals that can be retrieved and used in End of Range frames. Totaled fields can also be automatically displayed on end of range images.

APPX dynamically maintains a numeric field for each sort level of a totaled field. It does not alter the contents of the field being totaled. As each level is subtotaled, the corresponding value of the totaled field is added to the next level and then cleared. In a subtotal image, a user can define the field being totaled on the image and request a display of the 'range' value. This causes APPX to display the value that was totaled for that sort level.

Using the sample code in the Example section below, assume that a cash receipts report is being printed with subtotals by account number and date, as well as grand totals. In this case, APPX allocates three work fields for total receipts. When the TOTAL statement is executed, APPX adds to the account number subtotal. When the account number subtotal prints, APPX adds the account number subtotal to the date subtotal and then zeros the account number subtotal. When the date subtotal prints, APPX adds the date subtotal to the grand total and then zeros the date subtotal. At the end of the report, APPX prints the grand total.

A user can retrieve a totaled value by using the SET TOT statement at the subtotal or grand total level. Thus, in our example, you can retrieve the value of WORK CASH RECEIVED in any subtotal or grand total image with the following statement:

          SET TOT    TAR WORK AMOUNT                    =  TAR WORK CASH RECEIVED

Related Statements

SET TOT

Example

In the following example, the TOTAL statement is used to accumulate daily cash receipts. Subtotals or grand totals can be printed on reports, or extracted using the SET TOT statement. 

          TOTAL     TAR WORK CASH RECEIVED               +  TAR RECEIPT2 CHECK AMOUNT

Application Design Manual                                         "Powered by Appx Software"

706

©2006 By APPX Software, Inc. All Rights Reserved